# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
pkgname=openxr
pkgver=1.0.27
pkgrel=1
pkgdesc='An open standard for virtual reality and augmented reality platforms and devices'
arch=('loong64' 'x86_64')
url='https://www.khronos.org/openxr/'
depends=('jsoncpp' 'libx11' 'vulkan-icd-loader' 'libglvnd' 'libxrandr' 'libxxf86vm')
makedepends=('cmake' 'vulkan-headers' 'python' 'ninja' 'wayland' 'mesa')
license=('APACHE')
source=("https://github.com/KhronosGroup/OpenXR-SDK-Source/releases/download/release-${pkgver}/OpenXR-SDK-Source-release-${pkgver}.tar.gz"{,.asc})
validpgpkeys=(F029455EAB70F520FF4A03BD7F534CD56F00321E)
sha512sums=('b7a94d9f3cb30d9349e1f65e587dfdd9e0685b5370e619d15da86c1b4408404d2456c0fa7c6bf4fb080eb0d7c216107d949817d3975c98bb8280ee0fa76f1723'
            'SKIP')

build() {
  cd OpenXR-SDK-Source-release-${pkgver}

  cmake \
    -GNinja \
    -Bbuild \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTS=ON \
    -DPRESENTATION_BACKEND=xlib \
    -DDYNAMIC_LOADER=ON
  ninja -C build
}

package() {
  cd OpenXR-SDK-Source-release-${pkgver}

  DESTDIR="$pkgdir" ninja -C build install
}
